<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="body">

            <h:form id="cepForm" enctype="multipart/form-data">
                <h1 class="title">
                    <a href="#" class="back" onclick="history.go(-1)"/>
                    Procedimento
                </h1>
                <div class="row">
                    <div class="twelve columns">
                        <p:messages autoUpdate="true"/>
                        <fieldset>
                            <legend> <h4 style="margin:0 0 10px 0">Dados Gerais</h4></legend>
                            <p:panel id="customerPrimary" style="background: none; border: none;" 
                                     styleClass="container_24 clearfix ">
                                <p:outputLabel value="Cód:" styleClass="grid_3"/>
                                <h:outputText styleClass="grid_3" value="#{managerSearchProcedure.showProcedure.cod}"/>
                                <p:outputLabel value="Nome:" styleClass="grid_2"/>
                                <h:outputText styleClass="grid_14" value="#{managerSearchProcedure.showProcedure.name}"/>
                                <div class="clear"/>
                                <p:outputLabel value="Duração: " styleClass="grid_3"/>
                                <h:outputText styleClass="grid_3" value="#{managerSearchProcedure.showProcedure.duration}"/>
                                
                                <p:outputLabel value="Tipo: " styleClass="grid_2"/>
                                <h:outputText styleClass="grid_14" value="#{managerSearchProcedure.showProcedure.typeProcedure.name}"/>
                                <div class="clear"/>
                                <p:outputLabel value="Grupo: " styleClass="grid_3"/>
                                <h:outputText styleClass="grid_14" 
                                              value="#{managerSearchProcedure.showProcedure.groupProcedure.name}"/>
                                
                            </p:panel>
                        </fieldset>
                        
                        <fieldset>
                            <legend> <h4 style="margin:0 0 10px 0">Valores</h4></legend>
                            <p:panel id="procedureValue" style="background: none; border: none;" 
                                     styleClass="container_24 clearfix ">

                                <p:dataTable id="valueDataTable" var="value" rowIndexVar="ddt" 
                                             emptyMessage="Nenhum valor cadastrado"
                                             value="#{managerSearchProcedure.showProcedure.valueProcedure}">  

                                    <f:facet name="header">  
                                        Valores por Convênio
                                    </f:facet>  

                                    <p:column headerText="Convênio">  
                                        <h:outputText value="#{value.operator.name}" />
                                    </p:column>  

                                    <p:column headerText="Valor">  
                                        <h:outputLabel value="#{value.amount}" >  
                                            <f:convertNumber type="currency" />
                                        </h:outputLabel>
                                            
                                    </p:column>  

                                </p:dataTable> 
                            </p:panel>
                        </fieldset>

                        <div class="buttonAction">
                          
                            <p:button href="searchprocedure.xhtml" value="Voltar"  icon="ui-icon-arrowreturnthick-1-w" />
                        </div >
                    </div>
                </div>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
